package com.wbl.train.business.controller;

import com.wbl.train.business.service.StationService;
import com.wbl.train.common.business.vo.StationVo;
import com.wbl.train.common.result.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 王博纶
 * @since 2024-02-01
 * @description 车站
 */
@AllArgsConstructor
@Slf4j
@RestController
@RequestMapping("/station")
@Tag(name = "车站控制器类",
        description = "StationController 车站 后端数据接口")
public class StationController {
    private final StationService stationService;

    /**
     * 查询所有的车站信息
     * @return Result
     */
    @Operation(summary = "查询所有车站", description = "查询所有车站")
    @GetMapping("/query_all")
    public R<List<StationVo>> getAllTrainStation() {
        // 火车车次查询
        List<StationVo> stationVos = stationService.queryAllStation();
        return R.ok("查询成功",stationVos);
    }
}
